package RTT.corba;
/**
* RTT/corba/COperationInterfacePOA.java .
* Generated by the IDL-to-Java compiler (portable), version "3.2"
* from OperationInterface.idl
* Wednesday, July 11, 2012 5:26:50 PM CEST
*/
/**
* Exposes the operations this service offers.
* @ingroup CompIDL
*/
public abstract class COperationInterfacePOA extends org.omg.PortableServer.Servant
implements RTT.corba.COperationInterfaceOperations, org.omg.CORBA.portable.InvokeHandler
{
// Constructors
private static java.util.Hashtable _methods = new java.util.Hashtable ();
static
{
_methods.put ("getOperations", new java.lang.Integer (0));
_methods.put ("getArguments", new java.lang.Integer (1));
_methods.put ("getArity", new java.lang.Integer (2));
_methods.put ("getCollectArity", new java.lang.Integer (3));
_methods.put ("getResultType", new java.lang.Integer (4));
_methods.put ("getArgumentType", new java.lang.Integer (5));
_methods.put ("getCollectType", new java.lang.Integer (6));
_methods.put ("getDescription", new java.lang.Integer (7));
_methods.put ("checkOperation", new java.lang.Integer (8));
_methods.put ("callOperation", new java.lang.Integer (9));
_methods.put ("sendOperation", new java.lang.Integer (10));
}
public org.omg.CORBA.portable.OutputStream _invoke (String $method,
org.omg.CORBA.portable.InputStream in,
org.omg.CORBA.portable.ResponseHandler $rh)
{
org.omg.CORBA.portable.OutputStream out = null;
java.lang.Integer __method = (java.lang.Integer)_methods.get ($method);
if (__method == null)
throw new org.omg.CORBA.BAD_OPERATION (0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);
switch (__method.intValue ())
{
/**
* Get a list of all operations.
*/
case 0: // RTT/corba/COperationInterface/getOperations
{
String $result[] = null;
$result = this.getOperations ();
out = $rh.createReply();
RTT.corba.COperationInterfacePackage.COperationListHelper.write (out, $result);
break;
}
/**
* Get a list of all arguments of a given operation.
*/
case 1: // RTT/corba/COperationInterface/getArguments
{
try {
String operation = in.read_string ();
RTT.corba.CArgumentDescription $result[] = null;
$result = this.getArguments (operation);
out = $rh.createReply();
RTT.corba.CDescriptionsHelper.write (out, $result);
} catch (RTT.corba.CNoSuchNameException $ex) {
out = $rh.createExceptionReply ();
RTT.corba.CNoSuchNameExceptionHelper.write (out, $ex);
}
break;
}
/**
* Returns the number of arguments required in callOperation() and sendOperation() for
* a given operation.
*/
case 2: // RTT/corba/COperationInterface/getArity
{
try {
String operation = in.read_string ();
short $result = (short)0;
$result = this.getArity (operation);
out = $rh.createReply();
out.write_ushort ($result);
} catch (RTT.corba.CNoSuchNameException $ex) {
out = $rh.createExceptionReply ();
RTT.corba.CNoSuchNameExceptionHelper.write (out, $ex);
}
break;
}
/**
* Returns the number of arguments required in CSendHandle::collect() and CSendHandle::collectIfDone() for
* a given operation.
*/
case 3: // RTT/corba/COperationInterface/getCollectArity
{
try {
String operation = in.read_string ();
short $result = (short)0;
$result = this.getCollectArity (operation);
out = $rh.createReply();
out.write_ushort ($result);
} catch (RTT.corba.CNoSuchNameException $ex) {
out = $rh.createExceptionReply ();
RTT.corba.CNoSuchNameExceptionHelper.write (out, $ex);
}
break;
}
/**
* Get a result type of a given operation.
*/
case 4: // RTT/corba/COperationInterface/getResultType
{
try {
String operation = in.read_string ();
String $result = null;
$result = this.getResultType (operation);
out = $rh.createReply();
out.write_string ($result);
} catch (RTT.corba.CNoSuchNameException $ex) {
out = $rh.createExceptionReply ();
RTT.corba.CNoSuchNameExceptionHelper.write (out, $ex);
}
break;
}
/**
* Returns the argument or return type name of call as known to the Orocos type system.
*/
case 5: // RTT/corba/COperationInterface/getArgumentType
{
try {
String operation = in.read_string ();
short nbr = in.read_ushort ();
String $result = null;
$result = this.getArgumentType (operation, nbr);
out = $rh.createReply();
out.write_string ($result);
} catch (RTT.corba.CNoSuchNameException $ex) {
out = $rh.createExceptionReply ();
RTT.corba.CNoSuchNameExceptionHelper.write (out, $ex);
} catch (RTT.corba.CWrongArgumentException $ex) {
out = $rh.createExceptionReply ();
RTT.corba.CWrongArgumentExceptionHelper.write (out, $ex);
}
break;
}
/**
* Returns the argument type of collect as known to the Orocos type system.
*/
case 6: // RTT/corba/COperationInterface/getCollectType
{
try {
String operation = in.read_string ();
short nbr = in.read_ushort ();
String $result = null;
$result = this.getCollectType (operation, nbr);
out = $rh.createReply();
out.write_string ($result);
} catch (RTT.corba.CNoSuchNameException $ex) {
out = $rh.createExceptionReply ();
RTT.corba.CNoSuchNameExceptionHelper.write (out, $ex);
} catch (RTT.corba.CWrongArgumentException $ex) {
out = $rh.createExceptionReply ();
RTT.corba.CWrongArgumentExceptionHelper.write (out, $ex);
}
break;
}
/**
* Get a description of a given operation.
*/
case 7: // RTT/corba/COperationInterface/getDescription
{
try {
String operation = in.read_string ();
String $result = null;
$result = this.getDescription (operation);
out = $rh.createReply();
out.write_string ($result);
} catch (RTT.corba.CNoSuchNameException $ex) {
out = $rh.createExceptionReply ();
RTT.corba.CNoSuchNameExceptionHelper.write (out, $ex);
}
break;
}
/**
* Checks if a given operation accepts the list of arguments.
* If no exception is thrown, the arguments and operation name were valid.
*/
case 8: // RTT/corba/COperationInterface/checkOperation
{
try {
String operation = in.read_string ();
org.omg.CORBA.Any args[] = RTT.corba.CAnyArgumentsHelper.read (in);
this.checkOperation (operation, args);
out = $rh.createReply();
} catch (RTT.corba.CNoSuchNameException $ex) {
out = $rh.createExceptionReply ();
RTT.corba.CNoSuchNameExceptionHelper.write (out, $ex);
} catch (RTT.corba.CWrongNumbArgException $ex) {
out = $rh.createExceptionReply ();
RTT.corba.CWrongNumbArgExceptionHelper.write (out, $ex);
} catch (RTT.corba.CWrongTypeArgException $ex) {
out = $rh.createExceptionReply ();
RTT.corba.CWrongTypeArgExceptionHelper.write (out, $ex);
}
break;
}
/**
* Call an operation with a list of arguments.
* This method will block until the operation completes and returns its result.
*/
case 9: // RTT/corba/COperationInterface/callOperation
{
try {
String operation = in.read_string ();
RTT.corba.CAnyArgumentsHolder args = new RTT.corba.CAnyArgumentsHolder ();
args.value = RTT.corba.CAnyArgumentsHelper.read (in);
org.omg.CORBA.Any $result = null;
$result = this.callOperation (operation, args);
out = $rh.createReply();
out.write_any ($result);
RTT.corba.CAnyArgumentsHelper.write (out, args.value);
} catch (RTT.corba.CNoSuchNameException $ex) {
out = $rh.createExceptionReply ();
RTT.corba.CNoSuchNameExceptionHelper.write (out, $ex);
} catch (RTT.corba.CWrongNumbArgException $ex) {
out = $rh.createExceptionReply ();
RTT.corba.CWrongNumbArgExceptionHelper.write (out, $ex);
} catch (RTT.corba.CWrongTypeArgException $ex) {
out = $rh.createExceptionReply ();
RTT.corba.CWrongTypeArgExceptionHelper.write (out, $ex);
} catch (RTT.corba.CCallInterrupted $ex) {
out = $rh.createExceptionReply ();
RTT.corba.CCallInterruptedHelper.write (out, $ex);
}
break;
}
/**
* Send an operation with a list of arguments.
* This method will return immediately and return a CSendHandle.
*/
case 10: // RTT/corba/COperationInterface/sendOperation
{
try {
String operation = in.read_string ();
org.omg.CORBA.Any args[] = RTT.corba.CAnyArgumentsHelper.read (in);
RTT.corba.CSendHandle $result = null;
$result = this.sendOperation (operation, args);
out = $rh.createReply();
RTT.corba.CSendHandleHelper.write (out, $result);
} catch (RTT.corba.CNoSuchNameException $ex) {
out = $rh.createExceptionReply ();
RTT.corba.CNoSuchNameExceptionHelper.write (out, $ex);
} catch (RTT.corba.CWrongNumbArgException $ex) {
out = $rh.createExceptionReply ();
RTT.corba.CWrongNumbArgExceptionHelper.write (out, $ex);
} catch (RTT.corba.CWrongTypeArgException $ex) {
out = $rh.createExceptionReply ();
RTT.corba.CWrongTypeArgExceptionHelper.write (out, $ex);
} catch (RTT.corba.CCallInterrupted $ex) {
out = $rh.createExceptionReply ();
RTT.corba.CCallInterruptedHelper.write (out, $ex);
}
break;
}
default:
throw new org.omg.CORBA.BAD_OPERATION (0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);
}
return out;
} // _invoke
// Type-specific CORBA::Object operations
private static String[] __ids = {
"IDL:RTT/corba/COperationInterface:1.0"};
public String[] _all_interfaces (org.omg.PortableServer.POA poa, byte[] objectId)
{
return (String[])__ids.clone ();
}
public COperationInterface _this()
{
return COperationInterfaceHelper.narrow(
super._this_object());
}
public COperationInterface _this(org.omg.CORBA.ORB orb)
{
return COperationInterfaceHelper.narrow(
super._this_object(orb));
}
} // class COperationInterfacePOA